<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title></title>
  <style>
    div {
      width: 600px;
      height: 300px;
      background-color: red;
    }

    .div1 {
      opacity: 0.3;
    }

    .div2 {
      background-color: rgba(0, 0, 0, 0.3);
    }
    .div2 li:nth-child(2){
      color: red;
    }
  </style>
  <link href="css/style.css" rel="stylesheet">
</head>

<body>
  <div class="div1">
    <ol>
      <li>文字也会半透明</li>
      <li>0代表完全透明，1代表完全不透明</li>
    </ol>
  </div>
  <div class="div2">
    <ol>
      <li>文字不会半透明</li>
      <li>我怎么设置为红色呢？</li>
    </ol>

  </div>

</body>

</html>
